package com.chmingx.JavaBasic.collection;

public class Cat implements Comparable<Cat> {
    public int age;

    public Cat(int age) {
        this.age = age;
    }

    @Override
    public int compareTo(Cat o) {
        if (this.age == o.age) {
            return 0;
        }
        return this.age < o.age ? -1 : 1;
    }
}
